<?php
require_once dirname(__FILE__).'/includes/config.php'; 
$blog = $_GET['blog'];
$titre = 'Newsletter de '.$blog;
?>

<rss version="2.0">
		<channel>
			<title><?php echo $titre; ?></title>
			<description></description>
			<webMaster></webMaster>
<?php
echo '<link>http://'.$blog.'.skyrock.com/</link>';
$date = time();
$blog = mysql_real_escape_string($blog);
$retour = mysql_query('SELECT * FROM newsletter_newsletters WHERE newsletter="'.$blog.'" ORDER BY id DESC LIMIT 0,20');
while ($donnees = mysql_fetch_array($retour)) // On fait une boucle pour lister les news
{
echo '<item>';
echo '<title>'.stripslashes(html_entity_decode($donnees['titre'])).'</title>';
echo '<description><![CDATA['.stripslashes(html_entity_decode($donnees['contenu'])).']]></description>';
echo '<pubDate>'.date('D, d M Y H:i:s +0100', $donnees['time']).'</pubDate>';
echo '<link>http://boverie.eu/skyblog/newsletter/view.php?blog='.$blog.'#'.$donnees['id'].'</link>';
echo '<author>'.$donnees['email'].' ('.$donnees['newsletter'].')</author>';
echo '</item>';
}
?>
       </channel>
</rss>
